﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Text;
using Abp.Domain.Entities;
using FwProject.Comm.ExcelUtil;
using FwProject.Core.Distribution;
using FwProject.Core.Restaurant;

namespace FwProject.Distribution.Dto
{
    [DisplayName(displayName:"配送签收")]
    public class DistributionDetailsView:Entity<Guid>
    {
        [Display(Name = "支付状态")]
        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false)]
        [DisplayName(displayName: "支付状态")]
        public Pricestatus Pricestatus { get; set; }
        public Guid? SettlementId { get; set; }
        [Display(Name = "结账时间")]
        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false)]
        [DisplayName(displayName: "结账时间")]
        public DateTime? SettlementTime { get; set; }
        public long CreatorUserId { get; set; }
        [ExcelDateMember(IsMultiRow =false,IsMerged =false,IsClass =false)]
        [DisplayName(displayName:"配送单号")]
        [Display(Name="配送单号")]
        public string CreationNumber { get; set; }
        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false)]
        [DisplayName(displayName: "配送日期")]
        [Display(Name = "配送日期")]
        public DateTime CreationTime { get; set; }
        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false)]
       
        [DisplayName(displayName: "餐厅名称")]
        [Display(Name = "餐厅名称")]
        public string RestaurantName { get; set; }
        [Display(Name = "餐厅地址")]
        public string RestaurantAddress { get; set; }
        public Guid RestaurantId { get; set; }

        [Display(Name = "配送司机")]
        public string Name { get; set; }
        
        [Display(Name = "车牌号")]
        public string PlatesNumber { get; set; }
        [Display(Name = "司机手机")]
        public string Mobile { get; set; }
        [Display(Name = "所属工厂")]
        public Guid FactoryinfoId { get; set; }
       
        [Display(Name = "装车状态")]
        public CarStatus CarStatus { get; set; }
        [Display(Name = "出库审核状态")]
        public ExamineStatus ExamineStatus { get; set; }
        [Display(Name = "回库审核状态")]
        public BackStatus BackStatus { get; set; }

        [Display(Name = "配送箱数")]
        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false,IsSum =true)]
        [DisplayName(displayName: "配送箱数")]
        public int Distributioncount { get; set; }
        [Display(Name = "配送套数")]
        public int DistributionBycount { get; set; }
        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false, IsSum = true)]
        [DisplayName(displayName: "回收箱数")]
        [Display(Name = "回收箱数")]
        public int Recoverycount { get; set; }
        [Display(Name = "回收套数")]
        public int RecoveryBycount { get; set; }

        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false, IsSum = true)]
        [DisplayName(displayName: "换货箱数")]
        [Display(Name = "换货箱数")]
        public int Exchangegoodscount { get; set; }
        [Display(Name = "换货套数")]
        public int ExchangegoodsBycount { get; set; }
        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false, IsSum = true)]
        [DisplayName(displayName: "折损套数")]
        [Display(Name = "折损套数")]
        public int Damagecount { get; set; }
        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false,IsSum = true)]
        [DisplayName(displayName: "赠送箱数")]
        [Display(Name = "赠送箱数")]
        public int Givecount { get; set; }
        [Display(Name ="赠送套数")]
        public int GiveBycount { get; set; }
        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false, IsSum = true)]
        [DisplayName(displayName: "退回箱数")]
        [Display(Name = "退回箱数")]
        public int Backboxcount { get; set; }

        public int BackboxBycount { get; set; }

        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false, IsSum = true)]
        [DisplayName(displayName: "总退回套数")]
        [Display(Name = "总退回套数")]
        public int BackboxSumBycount { get { return BackboxBycount + Backnumbercount; } }


        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false, IsSum = true)]
        [DisplayName(displayName: "退回套数")]
        [Display(Name = "退回套数")]
        public int Backnumbercount { get; set; }

        //[ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false, IsSum = true)]
        //[DisplayName(displayName: "退回套数(箱)")]
        //[Display(Name = "退回套数(箱)")]
        //public int BackboxBycount { get; set; }


        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false,IsSum =true)]
        [DisplayName(displayName: "应收金额")]
        [Display(Name = "应收金额")]
        public decimal TotalPrice { get; set; }

        [ExcelDateMember(IsMultiRow = false, IsMerged = false, IsClass = false, IsSum = true)]
        [DisplayName(displayName: "店存")]
        [Display(Name = "店存")]
        public int Stock { get; set; }

        public int DistributionStock { get; set; }
        
    }
}
